// import Cookies from 'js-cookie'

const TokenKey = 'token';
const RouterKey = 'router_id';

export function getToken() {
    return localStorage.getItem(TokenKey)
}

export function setToken(token) {
    return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
    return localStorage.removeItem(TokenKey)
}


export function getRouterItem() {

    return JSON.parse(localStorage.getItem(RouterKey));
}

export function setRouterItem(value) {
    if (value instanceof Object) {
        value = JSON.stringify(value);
    }
    return localStorage.setItem(RouterKey, value);
}

export function removeRouterItem() {
    return localStorage.removeItem(RouterKey)
}


